﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Calculator
{
    class Program
    {
        static void Main(string[] args)
        {
            DGraph g = new DGraph();
            g.ConnectNode(0, Node.create(5));
            g.ConnectNode(0, Node.create(2));
            g.ConnectNode(0, Node.create(1));

            g.ConnectNode(3, Node.create(6));
            g.ConnectNode(3, Node.create(5));
            g.ConnectNode(3, Node.create(4));

            g.ConnectNode(6, Node.create(4));
            g.ConnectNode(6, Node.create(0));

            g.ConnectNode(3, Node.create(2));

            g.ConnectNode(1, Node.create(4));

            g.ConnectNode(5, Node.create(2));

            g.SortTopologically(3);
        }
    }
}
